<?php

namespace App\Http\Controllers\Common;

use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class CommonController extends Controller
{
    /**
	 * [检测来源请求来自哪个地方]
	 * @param  [string] $url [指定来源的地址]
	 * @return [bool]      [是url地址返回true,否则false]
	 */
	public static function urlSource($url)
	{
	    if(isset($_SERVER['HTTP_REFERER']) && $_SERVER['HTTP_REFERER'] == $url) {
	        return true;
	    }
	    return false;
	}
}
